package com.app.service.impl;

import com.app.dao.AppCategoryMapper;
import com.app.dao.DataDictionaryMapper;
import com.app.entity.AppCategory;
import com.app.entity.DataDictionary;
import com.app.service.CommonService;
import com.app.util.AppSystem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommonServiceImpl implements CommonService {
    @Autowired
    private DataDictionaryMapper dataDictionaryMapper;
    @Autowired
    private AppCategoryMapper appCategoryMapper;
    @Override
    public List<DataDictionary> getFlatformList() {
        return dataDictionaryMapper.getDataListByTypeCode(AppSystem.Dictionary.APP_FLATFORM);
    }

    @Override
    public List<AppCategory> getOneCategoryList() {
        return appCategoryMapper.getCategoryList(AppSystem.Category.ALL_GAME_ID);
    }

    @Override
    public List<AppCategory> getCategoryListByParentId(Long parentId) {
        return appCategoryMapper.getCategoryList(parentId);
    }
}
